<!DOCTYPE html>
<html lang="zh-CN">


<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  <title>
    linux基础 | Haitao Space
  </title>
  <meta name="description" content="Stay hungry, stay foolish.">
  
  <meta name="keywords" content="
  linux
  ">
  
  <meta name="author" content="haitaoW">

  <meta http-equiv="Cache-Control" content="no-transform">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="theme-color" content="#1e2327">
  <link rel="apple-touch-icon" href="https://github.githubassets.com/apple-touch-icon.png">
  <link rel="apple-touch-icon" sizes="180x180" href="https://github.githubassets.com/apple-touch-icon-180x180.png">

  <link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
  <link rel="stylesheet" href="/css/main.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  

  

  <script src="//cdnjs.cloudflare.com/ajax/libs/vue/1.0.25-csp/vue.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script>
</head>

<body id="replica-app">

<nav class="navbar-wrapper">
  <div class="navbar">
    <div class="container clearfix">
      <a href="/" class="navbar-logo"><i class="fa fa-github"></i></a>

      <div class="navbar-search float-left desktop-only">
        <div class="navbar-search-form">
          <label for="gsc-i-id1">This website</label>
          <div id="google-search">
            <gcse:search></gcse:search>
          </div>
        </div>
      </div>

      <ul class="navbar-nav float-left">
        
        <li><a href="/archives">Archives</a></li>
        
        
        <li><a href="/categories">Categories</a></li>
        
        
        <li><a href="/tags">Tags</a></li>
        
        
        <li class="desktop-only"><a href="/atom.xml" target="_blank">RSS</a></li>
        
      </ul>

      <ul class="navbar-nav user-nav float-right desktop-only">
        <li class="user-nav-notification">
          <a><span class="user-nav-unread"></span><i class="fa fa-bell"></i></a>
        </li>
        <li>
          <a><i class="fa fa-plus"></i> <i class="fa fa-caret-down"></i></a>
        </li>
        <li class="user-nav-logo">
          <a><img src="https://ws1.sinaimg.cn/large/006VKYWFly1g5b0lv0x0qj30rs0mn4gt.jpg"> <i class="fa fa-caret-down"></i></i></a>
        </li>
      </ul>
    </div>
  </div>
</nav>

<div class="main-container">
  <header class="header-wrapper desktop-only">
  <div class="container header-site-detail">
    <ul class="header-toolbar">
      <li class="clearfix">
        <a href="/archives" class="header-toolbar-left"><i
                  class="fa fa-file-text"></i> Posts </a>
        <a href="/archives"
           class="header-toolbar-right"> 10 </a>
      </li>
      <li>
        <a href="/tags" class="header-toolbar-left"><i
                  class="fa fa-tags"></i> Tags </a>
        <a href="/tags"
           class="header-toolbar-right"> 8 </a>
      </li>
      <li>
        <a href="/categories" class="header-toolbar-left"><i
                  class="fa fa-folder-open"></i> Categories </a>
        <a href="/categories"
           class="header-toolbar-right"> 5 </a>
      </li>
    </ul>
    <h2 class="header-title">
      <i class="fa fa-book text-muted"></i>
      <a href="/">Haitao Space</a>
      
      
    </h2>
  </div>

  <div class="container">
    <div class="header-tab-wrapper clearfix">
      <span class="header-tab header-tab-selected"><i class="fa fa-thumbs-o-up"></i> Like</span>
      <span class="header-tab"><i class="fa fa-share-alt"></i> Share</span>
      <span class="header-tab"><i class="fa fa-comments-o"></i> Discussion</span>
      <span class="header-tab"><i class="fa fa-bookmark-o"></i> Bookmark </span>
      <span class="header-tab"><i class="fa fa-smile-o"></i> Smile <i class="fa fa-caret-down"></i></span>
    </div>
  </div>
</header>


<div class="post-container container">
  <h3>
    <i class="fa fa-user-o"></i>
    haitaoW

    <span class="post-date float-right" title="{{moment(1564842750000).format('MMM DD, YYYY, h:mm:ss A')}}">
      <i class="fa fa-pencil-square-o"></i>
      {{moment(1564842750000).fromNow()}}
    </span>
  </h3>

  <article class="post-content">
    <h1>linux基础</h1>
    <blockquote>
<h3 id="linux基础"><a href="#linux基础" class="headerlink" title="linux基础"></a>linux基础</h3><ol>
<li><p><strong>Linux中断实现机制和中断对外设时序间隙的影响、中断中不能用延时的原因</strong></p>
</li>
<li><h6 id="linux-内核态与用户态"><a href="#linux-内核态与用户态" class="headerlink" title="linux 内核态与用户态"></a>linux 内核态与用户态</h6></li>
<li><p>linux多线程与多进程通信</p>
</li>
</ol>
</blockquote>
<h3 id="linxu关键字："><a href="#linxu关键字：" class="headerlink" title="linxu关键字："></a>linxu关键字：</h3><h4 id="1-grep命令："><a href="#1-grep命令：" class="headerlink" title="1. grep命令："></a>1. grep命令：</h4><p>​    grep（global regular expression print）命令是一种强大的文本搜索工具，他能使用正则表达式搜索文本，并把匹配的行打印出来。</p>
<p>​    <strong>命令格式 grep [option] pattern files</strong></p>
<p>​    <strong>使用示例</strong></p>
<pre><code>1. 查看指定进程             `ps -ef|grep svn`
2. 查看进程个数           `ps -ef|grep svn -c`
3. 文件中读取关键词进行搜索    `cat test.txt | grep -f test2.txt`  //输出test.txt文件中含有从test2.txt文件中读取出的关键词的内容行，并显示每一行的行号</code></pre><ol start="4">
<li>在文件中查找关键字  <code>grep &#39;linux&#39; test.txt</code></li>
<li>找到以u开头的内容 <code>cat test.txt |grep ^u</code></li>
</ol>
<h4 id="2-Q：linux-中的文件-目录权限设置命令"><a href="#2-Q：linux-中的文件-目录权限设置命令" class="headerlink" title="2. Q：linux 中的文件/目录权限设置命令"></a>2. Q：linux 中的文件/目录权限设置命令</h4><p>​    <strong>A :  chmod</strong></p>
<h4 id="linux多线程与多进程通信"><a href="#linux多线程与多进程通信" class="headerlink" title="linux多线程与多进程通信"></a>linux多线程与多进程通信</h4><p>参考网址：</p>
<ol>
<li><a href="https://songlee24.github.io/2015/04/21/linux-IPC/" target="_blank" rel="noopener">https://songlee24.github.io/2015/04/21/linux-IPC/</a></li>
<li><a href="https://blog.csdn.net/gatieme/article/details/50908749" target="_blank" rel="noopener">https://blog.csdn.net/gatieme/article/details/50908749</a></li>
<li><a href="https://www.cnblogs.com/LUO77/p/5816326.html" target="_blank" rel="noopener">https://www.cnblogs.com/LUO77/p/5816326.html</a></li>
</ol>
<h4 id="linux下的锁机制"><a href="#linux下的锁机制" class="headerlink" title="linux下的锁机制"></a>linux下的锁机制</h4>
  </article>
</div>


    




</div>

<div class="footer-wrapper container">
  <footer class="footer clearfix">
    <div class="clearfix">
    <a href="https://haitao926.github.io" class="footer-logo">
      <i class="fa fa-github"></i>
    </a>
    <ul class="footer-social-link">
      <li>© 2019 haitaoW</li>
      <li><a href="https://haitao926.github.io">Home</a></li>
      
      <li><a href="https://github.com/haitao926">Github</a></li>
      
    </ul>
    <div class="footer-theme-info">
      Theme <a href="//github.com/sabrinaluo/hexo-theme-replica">Replica</a>
      by <a href="//github.com/sabrinaluo">Hiitea</a> ❤ Powered by Hexo
    </div>
    </div>
    
  </footer>
</div>




<script src="/js/main.js"></script>

</body>
</html>
